#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/6/2 11:00
# @Author  : TangZhongZheng
# @File    : main.py
# @Description :
import os
from data01.成员.deal_with import *
from data01.成员.insert_data import *

warnings.filterwarnings("ignore")

pd.options.mode.chained_assignment = None


def createDir():
    """
    创建日志目录，创建文件输出目录，创建文件读取目录
    :return:
    """
    if not os.path.isdir(logs):
        # 创建目录
        os.makedirs(logs)
    if not os.path.isdir(out):
        # 创建目录
        os.makedirs(out)
    if not os.path.isdir(file_path_name):
        # 创建目录
        os.makedirs(file_path_name)


if __name__ == '__main__':
    createDir()
    for subdir, dirs, files in os.walk(file_path_name):
        for file in files:
            path = os.path.join(subdir, file)
            data = pd.read_excel(io=path)
            data = deal_with(data, file)
            insert_data(data, file)
            print(path, 'done')
